package pcsr.drivers.epuckDriver.command;

public interface IePuckProtocol {

	// Start and End Delimiters constants
	public static byte STX = 0x02; // Packet start delimiter
	public static byte ETX = 0x03; // Packet end delimiter
	
	// Packet Type constants
	public class PACKETTYPE
	{
		public static byte REQUEST = 0x52; // A request sent to the Bluetooth module
		public static byte CONFIRM = 0x43; // The Bluetooth modules confirm to a request.
		public static byte INDICATION = 0x69; // Information sent from the Bluetooth module that is not a direct confirm to a request.
		public static byte RESPONSE = 0x72; // An optional response to an indication.
	}
	
	// Opcode constants
	public class OPCODE
	{
		public static byte GAP_INQUIRY 							= 0x00;
		public static byte GAP_DEVICE_FOUND 					= 0x01;
		public static byte GAP_REMOTE_DEVICE_NAME 				= 0x02;
		public static byte GAP_READ_LOCAL_NAME 					= 0x03;
		public static byte GAP_WRITE_LOCAL_NAME 				= 0x04;
		public static byte GAP_READ_LOCAL_BDA 					= 0x05;
		public static byte GAP_SET_SCANMODE 					= 0x06;
		public static byte GAP_GET_FIXED_PIN 					= 0x16;
		public static byte GAP_SET_FIXED_PIN 					= 0x17;
		public static byte GAP_GET_PIN 							= 0x75;
		public static byte GAP_GET_SECURITY_MODE 				= 0x18;
		public static byte GAP_SET_SECURITY_MODE				= 0x19;
		public static byte GAP_REMOVE_PAIRING 					= 0x1B;
		public static byte GAP_LIST_PAIRED_DEVICES 				= 0x1C;
		public static byte GAP_ENTER_SNIFF_MODE 				= 0x21;
		public static byte GAP_EXIT_SNIFF_MODE 					= 0x37;
		public static byte GAP_ENTER_PARK_MODE 					= 0x38;
		public static byte GAP_EXIT_PARK_MODE 					= 0x39;
		public static byte GAP_ENTER_HOLD_MODE 					= 0x3A;
		public static byte GAP_SET_LINK_POLICY 					= 0x3B;
		public static byte GAP_GET_LINK_POLICY 					= 0x3C;
		public static byte GAP_POWER_SAVE_MODE_CHANGED 			= 0x3D;
		public static byte GAP_ACL_ESTABLISHED 					= 0x50;
		public static byte GAP_ACL_TERMINATED 					= 0x51;
		public static byte GAP_SET_AUDIO_CONFIG 				= 0x59;
		public static byte GAP_GET_AUDIO_CONFIG 				= 0x5A;
		public static byte GAP_ESTABLISH_SCO_LINK 				= 0x5D;
		public static byte GAP_RELEASE_SCO_LINK 				= 0x5E;
		public static byte GAP_MUTE_MIC 						= 0x5F;
		public static byte GAP_SET_VOLUME 						= 0x60;
		public static byte GAP_GET_VOLUME 						= 0x61;
		public static byte GAP_CHANGE_SCO_PACKET_TYPE 			= 0x62;
		public static byte SPP_SET_PORT_CONFIG 					= 0x07;
		public static byte SPP_GET_PORT_CONFIG 					= 0x08;
		public static byte SPP_PORT_CONFIG_CHANGED 				= 0x09;
		public static byte SPP_ESTABLISH_LINK 					= 0x0A;
		public static byte SPP_LINK_ESTABLISHED 				= 0x0B;
		public static byte SPP_INCOMMING_LINK_ESTABLISHED 		= 0x0C;
		public static byte SPP_RELEASE_LINK 					= 0x0D;
		public static byte SPP_LINK_RELEASED 					= 0x0E;
		public static byte SPP_SEND_DATA 						= 0x0F;
		public static byte SPP_INCOMING_DATA 					= 0x10;
		public static byte SPP_TRANSPARENT_MODE 				= 0x11;
		public static byte SPP_CONNECT_DEFAULT_CON 				= 0x12;
		public static byte SPP_STORE_DEFAULT_CON 				= 0x13;
		public static byte SPP_GET_LIST_DEFAULT_CON 			= 0x14;
		public static byte SPP_DELETE_DEFAULT_CON 				= 0x15;
		public static byte SPP_SET_LINK_TIMEOUT 				= 0x57;
		public static byte SPP_GET_LINK_TIMEOUT 				= 0x58;
		public static byte SPP_PORT_STATUS_CHANGED 				= 0x3E;
		public static byte SPP_GET_PORT_STATUS 					= 0x40;
		public static byte SPP_PORT_SET_DTR 					= 0x41;
		public static byte SPP_PORT_SET_RTS 					= 0x42;
		public static byte SPP_PORT_BREAK 						= 0x43;
		public static byte SPP_PORT_OVERRUN_ERROR 				= 0x44;
		public static byte SPP_PORT_PARITY_ERROR 				= 0x45;
		public static byte SPP_PORT_FRAMING_ERROR 				= 0x46;
		public static byte SDAP_CONNECT 						= 0x32;
		public static byte SDAP_DISCONNECT 						= 0x33;
		public static byte SDAP_CONNECTION_LOST 				= 0x34;
		public static byte SDAP_SERVICE_BROWSE 					= 0x35;
		public static byte SDAP_SERVICE_SEARCH 					= 0x36;
		public static byte SDAP_SERVICE_REQUEST 				= 0x1E;
		public static byte SDAP_ATTRIBUTE_REQUEST 				= 0x3F;
		public static byte CHANGE_LOCAL_BDADDRESS 				= 0x27;
		public static byte CHANGE_NVS_UART_SPEED 				= 0x23;
		public static byte CHANGE_UART_SETTINGS 				= 0x48;
		public static byte SET_PORTS_TO_OPEN 					= 0x22;
		public static byte GET_PORTS_TO_OPEN 					= 0x1F;
		public static byte RESTORE_FACTORY_SETTINGS 			= 0x1A;
		public static byte STORE_CLASS_OF_DEVICE 				= 0x28;
		public static byte FORCE_MASTER_ROLE 					= 0x1D;
		public static byte READ_OPERATION_MODE 					= 0x49;
		public static byte WRITE_OPERATION_MODE 				= 0x4A;
		public static byte SET_DEFAULT_LINK_POLICY 				= 0x4C;
		public static byte GET_DEFAULT_LINK_POLICY 				= 0x4D;
		public static byte SET_EVENT_FILTER 					= 0x4E;
		public static byte GET_EVENT_FILTER 					= 0x4F;
		public static byte SET_DEFAULT_LINK_TIMEOUT 			= 0x55;
		public static byte GET_DEFAULT_LINK_TIMEOUT 			= 0x56;
		public static byte SET_DEFAULT_AUDIO_CONFIG 			= 0x5B;
		public static byte GET_DEFAULT_AUDIO_CONFIG 			= 0x5C;
		public static byte SET_DEFAULT_LINK_LATENCY 			= 0x63;
		public static byte GET_DEFAULT_LINK_LATENCY 			= 0x64;
		public static byte SET_PCM_SLAVE_CONFIG 				= 0x74;
		public static byte SET_DEFAULT_SNIFF_MODE_PARAMETERS 	= 0x76;
		public static byte GET_DEFAULT_SNIFF_MODE_PARAMETERS 	= 0x77;
		public static byte ENABLE_SDP_RECORD 					= 0x29;
		public static byte DELETE_SDP_RECORDS 					= 0x2A;
		public static byte STORE_SPP_RECORD 					= 0x2B;
		public static byte STORE_DUN_RECORD 					= 0x2C;
		public static byte STORE_FAX_RECORD 					= 0x2D;
		public static byte STORE_OPP_RECORD 					= 0x2E;
		public static byte STORE_FTP_RECORD 					= 0x2F;
		public static byte STORE_SYNC_RECORD					= 0x30;
		public static byte STORE_SDP_RECORD 					= 0x31;
		public static byte RESET 								= 0x26;
		public static byte LMX9820A_READY 						= 0x25;
		public static byte TEST_MODE 							= 0x24;
		public static byte FIRMWARE_UPGRADE 					= 0x47;
		public static byte READ_RSSI 							= 0x20;
		public static byte RF_TEST_MODE 						= 0x4B;
		public static byte DISABLE_TL 							= 0x52;
		public static byte TL_ENABLED 							= 0x53;
		public static byte HCI_COMMAND 							= 0x65;
		public static byte READ_NVS 							= 0x72;
		public static byte WRITE_NVS 							= 0x73;
	}
	// Error codes
	enum ErrorType
    {
        BAD_SERIAL_PORT    ,
        BAD_BAUD_RATE      ,
        BAD_PORT_NUMBER    ,
        BAD_STOP_BITS      ,
        BAD_PARITY         ,
        BAD_BYTESIZE       ,
        PORT_ALREADY_OPEN  ,
        PORT_NOT_OPEN      ,
        OPEN_ERROR         ,
        WRITE_ERROR        ,
        READ_ERROR         ,
        CLOSE_ERROR        ,
        PURGECOMM          ,
        FLUSHFILEBUFFERS   ,
        GETCOMMSTATE       ,
        SETCOMMSTATE       ,
        SETUPCOMM          ,
        SETCOMMTIMEOUTS    ,
        CLEARCOMMERROR
    };
}
